Skip to content

chore: improve crates.io metadata and add cargo publish to release#29

Merged
mikkeldamsgaard merged 1 commit intomainfrom
chore/crates-io-metadata
Feb 26, 2026
Merged

chore: improve crates.io metadata and add cargo publish to release#29
mikkeldamsgaard merged 1 commit intomainfrom
chore/crates-io-metadata

Conversation

@mikkeldamsgaard
Copy link
Contributor

Summary

  • Enrich Cargo.toml description with subcommand keywords (wait-for, migrate, seed, render, fetch) for better crates.io and AI search discoverability
  • Add rust-version = "1.88" MSRV, authors, and documentation pointing to docs.rs
  • Add exclude to reduce published crate size (drops tests, examples, CI, charts, docs from the package)
  • Add #![doc = include_str!("../README.md")] so docs.rs renders the full README as the crate landing page
  • Add cargo publish step to the release workflow, running after tests pass and before Docker builds

Setup required

Add a CARGO_REGISTRY_TOKEN repository secret (from https://crates.io/settings/tokens) for the publish step to work.

Test plan

  • cargo clippy --all-targets --all-features -- -D warnings — clean
  • cargo fmt -- --check — clean
  • cargo test --all-features — 163 tests pass
  • cargo package --list --allow-dirty — 32 files, no excluded dirs leak through

🤖 Generated with Claude Code

…rkflow

- Enrich description with subcommand keywords for search discoverability
- Add rust-version (MSRV 1.88), authors, and docs.rs documentation link
- Exclude tests/examples/CI/charts/docs from published crate to reduce size
- Add #![doc = include_str!("../README.md")] for docs.rs landing page
- Add cargo publish step to release workflow (requires CARGO_REGISTRY_TOKEN secret)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 26, 2026 18:55
@mikkeldamsgaard mikkeldamsgaard merged commit fd64c9a into main Feb 26, 2026
7 checks passed
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR enhances the crate's discoverability on crates.io and automates publishing to the Rust package registry. It enriches the Cargo.toml metadata with keyword-rich descriptions, sets the MSRV to 1.88, adds documentation links pointing to docs.rs, and excludes unnecessary directories from the published package. The PR also configures docs.rs to render the full README as the crate landing page and adds automated crates.io publishing to the release workflow.

Changes:

  • Enhanced Cargo.toml metadata with keyword-rich description, MSRV, authors, docs.rs documentation URL, and exclude patterns to reduce package size
  • Added doc attribute to include README.md in docs.rs rendering
  • Automated crates.io publishing in the release workflow after tests pass

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
Cargo.toml Added rust-version MSRV, authors, enriched description with subcommand keywords, updated documentation URL to docs.rs, and added exclude patterns
src/main.rs Added doc attribute to include README.md content in docs.rs crate documentation
.github/workflows/release.yml Added cargo publish step after tests pass and before Docker builds
CHANGELOG.md Documented metadata improvements and cargo publish automation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- run: cargo test --all
- name: Publish to crates.io
Copy link

Copilot AI Feb 26, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The cargo publish step lacks error handling for the case where the version has already been published to crates.io. If this workflow is re-run (e.g., due to a failure in a later step like Docker builds), cargo publish will fail because crate versions are immutable on crates.io. Consider adding || true or using cargo publish --dry-run first, or add a conditional check to skip publishing if the version already exists. Alternatively, add continue-on-error: true to allow the workflow to proceed even if publishing fails.

Suggested change
- name: Publish to crates.io
- name: Publish to crates.io
continue-on-error: true

Copilot uses AI. Check for mistakes.
@mikkeldamsgaard mikkeldamsgaard deleted the chore/crates-io-metadata branch February 26, 2026 19:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants